<?php   
/** 
* The administration panel. Controller 
* Панель администрирования. Контроллер  
* @author IT studio IRBIS-team 
* @copyright © 2009 IRBIS-team 
*/ 
///////////////////////////////////////////////////////// 

/** 
* Generation of page of an error at access out of system 
* Генерация страницы ошибки при доступе вне системы 
*/ 
    if(!defined('IRB_KEY')) 
    { 
       header("HTTP/1.1 404 Not Found");       
       exit(file_get_contents('../../404.html')); 
    } 
//////////////////////////////////////////////////////////
	
	require_once(IRB_ROOT.'libs/mysql.php');


function getUsers(){

	$query = mysqlQuery("SELECT * FROM `soc_user`");
	
	if(mysql_num_rows($query) > 0)
	{
		while($row = mysql_fetch_assoc($query))
		{
			if(!empty($row['country']))
			{
				$country = mysql_fetch_assoc(mysqlQuery("SELECT name FROM country WHERE country_id=".$row['country'].""));
				$row['country_name'] = $country['name'];
			}
			
			if(!empty($row['region']))
			{	
				$region = mysql_fetch_assoc(mysqlQuery("SELECT name FROM region WHERE region_id=".$row['region'].""));
				$row['region_name'] = $region['name'];
			}
			
			if(!empty($row['city']))
			{
				$city = mysql_fetch_assoc(mysqlQuery("SELECT name FROM city WHERE city_id=".$row['city'].""));
				$row['city_name'] = $city['name'];
			}
			
			$users[] = $row;
			
		}
		
		return $users;
	}
}

	$users = getUsers();
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
          
